﻿namespace MicroCloud.EventBuses
{
    /// <summary>
    /// 事件数据基类
    /// </summary>
    public abstract class EventDataBase : IEventData
    {
        /// <summary>
        /// 初始化一个事件数据基类 <see cref="EventDataBase"/> 的新实例
        /// </summary>
        protected EventDataBase()
        {
            Id = Guid.NewGuid();
            EventTime = DateTime.Now;
        }

        #region 属性
        /// <summary>
        /// 获取 事件编号
        /// </summary>
        public Guid Id { get; private set; }
        
        /// <summary>
        /// 获取 事件时间
        /// </summary>
        public DateTime EventTime { get; private set; }
        
        /// <summary>
        /// 获取或设置 事件源(触发事件的对象)
        /// </summary>
        public object EventSource { get; set; }

        #endregion
    }
}